$(document).ready(function(e) {
    
	//滑动一定距离后每日推荐固定位置
	var width = $(window).width();
	var offset = 0;
	if(0<=width&&width<=360){
		offset = 12;
	}
	if(361<=width&&width<=410){
		offset = 14;	
	}
	if(411<=width&&width<=480){
		offset = 16;	
	}
	if(481<=width&&width<=570){
		offset = 18;	
	}
	if(571<=width&&width<=640){
		offset = 22;	
	}
	if(width>640){
		offset = 18;
	}
	var el = $('#title');
	var elTop = el.offset().top-3.2*offset;
	var sTop = 0;
	$('.main').scroll(function(e) {
		sTop = $('.main').scrollTop();
		if (sTop > elTop) {
			$('.title_h').addClass('on');
			$('.g_head').addClass('on');
		} else {
			$('.title_h').removeClass('on');
			$('.g_head').removeClass('on');	
		}  
	})
	
});